import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'

Vue.use(VueRouter)

const routes = [{
    path: '/',
    name: 'Home',
    component: Home
  },
  {
    path: '/home_p',
    name: 'Home_p',
    component: () => import('../views/Home_p.vue'),
    children: [{
        path: '/index',
        name: 'Index',
        component: () => import('../views/Index.vue')
      }, {
        path: '/study',
        name: 'Study',
        component: () => import('../views/Study.vue')
      },
      {
        path: '/news',
        name: 'News',
        component: () => import('../views/News.vue')
      },
      {
        path: '/travel',
        name: 'Travel',
        component: () => import('../views/Travel.vue')
      },
      {
        path: '/introduce',
        name: 'Introduce',
        component: () => import('../views/Introduce.vue')
      },
      {
        path: '/register',
        name: 'Register',
        component: () => import('../views/Register.vue')
      },
      {
        path: '/login',
        name: 'Login',
        component: () => import('../views/Login.vue')
      },
      {
        path: '/oder',
        name: 'Oder',
        component: () => import('../views/Oder.vue')
      }
    ],
    redirect: '/index'
  },
  {
    path: '/home_m',
    name: 'Home_m',
    component: () => import('../views/Home_m.vue'),
    children: [{
      path: '/index_m',
      name: 'Index_m',
      component: () => import('../views/Index_m.vue')
    }, {
      path: '/city_m',
      name: 'City_m',
      component: () => import('../views/City_m.vue')
    }, {
      path: '/phone_m',
      name: 'Phone_m',
      component: () => import('../views/Phone_m.vue')
    }, {
      path: '/call_m',
      name: 'Call_m',
      component: () => import('../views/Call_m.vue')
    }, {
      path: '/mine_m',
      name: 'Mine_m',
      component: () => import('../views/Mine_m.vue')
    }, ],
    redirect: '/index_m'
  },

]

const router = new VueRouter({
  mode: 'hash',
  base: process.env.BASE_URL,
  routes
})

export default router
